#encoding=utf-8
from Numeric import *
from math import *
n=input("Enter no. of data set:")
a=zeros(n,Float)    #creating an empty array
b=zeros(n,Float)    #creating an empty array
sum_x=0
sum_y=0
sum_XX=0
sum_YY=0
sum_XY=0
for i in range(n):
	x=input("Enter x:")
	y=input("Enter y:")
	a[i]=x
	b[i]=y
	sum_x=sum_x+x
	sum_y=sum_y+y
p=sum_x/n    #mean of x
q=sum_y/n    #mean of y
for i in range(n):
	X=a[i]-p
	Y=b[i]-q
	XX=pow(X,2)
	YY=pow(Y,2)
	sum_XX=sum_XX+XX
	sum_YY=sum_YY+YY
	XY=X*Y
	sum_XY=sum_XY+XY
r=sum_XY/(sqrt(sum_XX*sum_YY))    #Pearson's coefficient of correlation
print "The Pearson's coefficient of correlation is %s"%r 
